package org.infodavid.common.persistence;

import javax.persistence.PersistenceException;

import org.infodavid.common.persistence.exceptions.IErrorHandler;

/**
 * The Interface IPersistenceProvider.
 */
public interface IBasicPersistenceProvider {

	/**
	 * Release.
	 *
	 * @param session
	 *            the session
	 * @throws PersistenceException
	 *             The persistence exception
	 */
	void release(PersistenceSession session) throws PersistenceException;

	/**
	 * Gets the error handler.
	 *
	 * @return The error handler
	 */
	IErrorHandler<PersistenceException> getErrorHandler();

	/**
	 * Sets the error handler.
	 *
	 * @param handler
	 *            The error handler to set
	 */
	void setErrorHandler(IErrorHandler<PersistenceException> handler);
}
